import utils.mylog as logging
from services.device import Device
from services.input_manager import InputManager
from services.input_policy import *

import time

logger = logging.getLogger("main")


if __name__ == '__main__':
    policy = "random"
    logger.info(f"---------------------oh bot start, 策略:{policy}-------------------------")
    # 设备
    device = Device('127.0.0.1:5555')
    device.connect()
    # TODO:应用环境初始化
    # 开始执行
    start_time = time.time()
    try:
        input_manager = InputManager(policy, device)
        input_manager.start()
        end_time = time.time()
        input_manager.UTG.draw_graph()
        print(f"---------代码执行耗时: {end_time - start_time} 秒------------")
    finally:
        # 设备断连
        device.disconnect()



